<?php

namespace App\Http\Resources;

class GroupWithHasJoined extends Group
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return array_merge(parent::toArray($request), [
            'has_joined' => (bool)$this->account,
        ]);
    }
}
